<route lang="json5" type="page">
{
  style: {
    navigationBarTitleText: '',
  },
}
</route>

<template>
  <view class="detail" v-if="noticeInfo.id">
    <view class="title">{{ noticeInfo.title }}</view>
    <view class="content">
      <rich-text :nodes="noticeInfo.content" />
    </view>
  </view>
  <Seat v-else :loading="loading" />
</template>

<script lang="ts" setup>
const noticeInfo = ref({})
const loading = ref(false)

onLoad((query) => {
  if (query.id) {
    loading.value = true
    uni.showLoading()
    http
      .get('/notice-app/open/detail', {
        id: query.id,
      })
      .then((res: any) => {
        noticeInfo.value = res
      })
      .finally(() => {
        loading.value = false
        uni.hideLoading()
      })
  }
})
</script>

<style lang="scss" scoped>
.detail {
  box-sizing: border-box;
  min-height: 100vh;
  padding: 35rpx 30rpx;
  // background-color: var(--bgc4);

  .title {
    font-size: 36rpx;
    font-weight: bold;
    text-align: center;
  }

  .content {
    margin-top: 40rpx;
  }
}
</style>
